<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta content="user-scalable=no,width=device-width, initial-scale=1" id="viewport" name="viewport" initial-scale="1">

<script language="javascript" type="text/javascript" src="../js/js/baseJs.js"></script>

</head>
<body style="background:#eff6ff">

<div class="wap-my-requirements" id="myRequirements" style="display: none;">
    <div class="wap-header">我已推项目
        <a class="back" onClick="javascript:window.history.back();return false;"></a>
    </div>
    <div class="my-content-bd" style="position:static;margin-top:1rem" id="requireContent">
      <div >   
        <div class="l-content" v-for="projectData  in applyProjectData">
          <div class="title"> 
              <div>时间：{{projectData.createTime|formatData}}</div>
              <div style="color:#3580e5;min-width: 1.8rem;text-align: right;">状态：{{projectData.status|status}}</div>
          </div>          
          <div class="content">名称：{{projectData.projectItemName}}</div>
		  <div style="display: flex;justify-content: flex-end;">
			  <div class="btn" @click="goIdentification(projectData)" v-if="projectData.projectItemName=='免费安装pos机'&&projectData.status!=='4'&&!projectData.bankCardNegative">实名认证</div>
			  <div class="btn" style="background: #13CE66;" v-if="projectData.bankCardNegative&&projectData.status!=='4'">已实名</div>
			  <div  style="color: red;margin:0  .4rem .2rem;" v-if="projectData.status=='4'" >驳回原因：{{projectData.rejectReason}}</div> 
		  </div>
		  
        </div>
      </div>
    </div>
    <div class="wap-warning-message" v-if="messageContent">{{messageContent}}</div>
</div>
<script src="../js/js/rem_fix.js"></script>
<script src="../js/js/common.js"></script>
<script type="text/javascript">
   var token=getCookie("userToken");
   var userId=getCookie("userId");
   console.log(token)
   console.log(userId)
   var loginUrl="../userBundle/login.mobile.html"+"?"+"../userBundle/myRequirements.mobile.html";
   console.log(loginUrl)
   if(!token||!userId){
      window.location.href =loginUrl;
   }
  
  var uploadPayInfoApp = new Vue({
      el: '#myRequirements', 
      data: {
           applyProjectData:[],
           page:1,
           isDoingRefresh:false,
           isDoingloding:false,
           messageContent:''
      },
      ready:function(){
        $("#myRequirements").show();
          var url="/project/getProjectItemUsersByUser ";
          var data={         
              client: 1,
              token: token,
              userId: userId
            };
            pushData(url,data,function(res){
              console.log(res)
               if(res.state){
                this.applyProjectData=res.data.projectItemUsers;
               }else{
                alert(res.message);
               }
            }.bind(this));

      },
      filters:{
        status: function (key) {
            key = parseInt(key);
            var map = { 
                0: "删除",               
                1: "申请中",
                2: "处理中", 
                3: "成功",
				4: "驳回",
                9: "获取积分",    
            };
            return map[key];
        },
        formatData:function(key){
          return formatDate(key)
        }
      },  
      methods:{
        goIdentification:function(projectData){
			if(projectData.projectItemName=='免费安装pos机'&&projectData.status!=='4'){
				window.location.href="/userBundle/identification.mobile.html#"+projectData.id
			}
		}     
             
      }
    });

</script>

</body>
</html>